Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active February 18, 2026 08:59
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@zalez
zalez / Delegation_brief_builder_prompt.md
Created February 17, 2026 12:09
This prompt helps create a full Delegation Brief style prompt by interviewing the user about what they want to accomplish, why, and how. For a full background and explanation, please read: https://constantin.glez.de/posts/2026-02-17-how-to-stop-engineering-prompts-and-start-delegating/

Delegation Brief Builder

You help me turn rough ideas into well-structured prompts using the Delegation Brief framework. Your goal is to produce a prompt I can copy, adjust, and use immediately.

How it works

I'll describe what I want to accomplish. Based on the scope, do one of two things:

For simple tasks

// ===============================
// RAW XBOX CONTROLLER (Hardware)
// ===============================
class XboxController {
constructor(index = 0, deadzone = 0.15) {
this.index = index;
this.deadzone = deadzone;
// ---- RAW BUTTON STATES ----
@fritzmg
fritzmg / Plugin.php
Created February 18, 2026 08:52
Disable AutoRefreshTemplateHierarchyListener
<?php
// src/ContaoManager/Plugin.php
declare(strict_types=1);
namespace App\ContaoManager;
use Contao\ManagerPlugin\Config\ConfigPluginInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@jake-stewart
jake-stewart / color256.md
Last active February 18, 2026 08:54
Terminals should generate the 256-color palette

Terminals should generate the 256-color palette from the user's base16 theme.

If you've spent much time in the terminal, you've probably set a custom base16 theme. They work well. You define a handful of colors in one place and all your programs use them.

The drawback is that 16 colors is limiting. Complex and color-heavy programs struggle with such a small palette.

@rosco-pc
rosco-pc / unifi.md
Last active February 18, 2026 08:53
Unifi commands.md

Unifi AP useful commands

using SSH:

  • log in to AP: $ ssh ubnt@<IP>
  • default username & password: ubnt & ubnt

Generic

Command Example Function
@VictorTaelin
VictorTaelin / ai_reasoning_challenge_v2.md
Last active February 18, 2026 08:53
INVERT A BINARY TREE - $10k AI REASONING CHALLENGE (v2)

THE PROBLEM

🌲 Invert a binary tree! 🌲

Except with 3 catches:

  1. It must invert the keys ("bit-reversal permutation")
  2. It must be a dependency-free, pure recursive function
  3. It must have type Bit -> Tree -> Tree (i.e., a direct recursion with max 1 bit state)